#include "properties.hxx"

/*
int registry_property_demo(METHOD_message_t* msg, va_list args) {
	BEGIN;
	METHOD_id_t	method = {0, NULL};
	REGISTER_PROPERTY("", "", "", NULL, NULL, method);
	END;
}
*/

//TODO: 动态属性(properties)
//注意： 1.此方法在TC 10之后已被废弃，请慎重使用
//      2.按西门子文档说明，动态属性在TC8之后，应当在BMIDE中定义

char type[] = "Item";
USER_prop_init_entry_t user_types_methods[] = {
	//业务对象类型,   注册函数,        用户参数
	{ NULL,          NULL,           NULL }
};

int OUR_register_properties(int* decision, va_list args) {
	BEGIN;
	int registered = 0;
	int array_size = sizeof(user_types_methods) / sizeof(USER_prop_init_entry_t);
	for (int i = 0; i < array_size - 1; i++) {
		info_syslog("+Properties for '%s'\n", user_types_methods[i].type_name);
	}
	if (array_size - 1 > 0) {
		CHECK(TCTYPE_register_properties(user_types_methods, array_size));
		if (ITK_ok == ifail) {
			registered = array_size - 1;
		}
	}
	info_syslog("*There are %d/%d properties in '%s.%s' registered.\n\n",
		registered, array_size - 1, EX_STRING(SITE), __FUNCTION__);
	END;
}
